Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 7 pull requests #111960

Merged
merged 20 commits into from
May 26, 2023
Merged

Rollup of 7 pull requests #111960

merged 20 commits into from
May 26, 2023

Conversation

compiler-errors
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

lowr and others added 20 commits May 19, 2023 19:04
Additionally add analogous test for early lints.
Also merge the two almost identical strikethrough tests together and document what the test tests.
Add Median of Medians fallback to introselect

Fixes rust-lang#102451.

This PR is a follow up to rust-lang#106997. It adds a Fast Deterministic Selection implementation as a fallback to the introselect algorithm used by `select_nth_unstable`. This allows it to guarantee O(n) worst case running time, while maintaining good performance in all cases.

This would fix rust-lang#102451, which was opened because the `select_nth_unstable` docs falsely claimed that it had O(n) worst case performance, even though it was actually quadratic in the worst case. rust-lang#106997 improved the worst case complexity to O(n log n) by using heapsort as a fallback, and this PR further improves it to O(n) (this would also make rust-lang#106933 unnecessary).
It also improves the actual runtime if the fallback gets called: Using a pathological input of size `1 << 19` (see the playground link in rust-lang#102451), calculating the median is roughly 3x faster using fast deterministic selection as a fallback than it is using heapsort.

The downside to this is less code reuse between the sorting and selection algorithms, but I don't think it's that bad. The additional algorithms are ~250 LOC with no `unsafe` blocks (I tried using unsafe to avoid bounds checks but it didn't noticeably improve the performance).
I also let it fuzz for a while against the current `select_nth_unstable` implementation to ensure correctness, and it seems to still fulfill all the necessary postconditions.

cc `@scottmcm` who reviewed rust-lang#106997
…rd, r=GuillaumeGomez

update `pulldown-cmark` to `0.9.3`

This PR updates `pulldown-cmark` to version `0.9.3`, which does two main things:
* Pulls in pulldown-cmark/pulldown-cmark#643 to fix rust-lang#111117
* Allows parsing strikethrough with single tildes, e.g. `~foo~` -> ~foo~. This matches the [GFM spec](https://github.github.com/gfm/#strikethrough-extension-).

Full changelog: pulldown-cmark/pulldown-cmark#646
…=eholk

Consider lint check attributes on match arms

Currently, lint check attributes on match arms have no effect for some lints. This PR makes some lint passes to take those attributes into account.

- `LateContextAndPass` for late lint doesn't update `last_node_with_lint_attrs` when it visits match arms. This leads to lint check attributes on match arms taking no effects on late lints that operate on the arms' pattern:

  ```rust
  match value {
      #[deny(non_snake_case)]
      PAT => {} // `non_snake_case` only warned due to default lint level
  }
  ```

  To be honest, I'm not sure whether this is intentional or just an oversight. I've dug the implementation history and searched up issues/PRs but couldn't find any discussion on this.

- `MatchVisitor` doesn't update its lint level when it visits match arms. This leads to check lint attributes on match arms taking no effect on some lints handled by this visitor, namely: `bindings_with_variant_name` and `irrefutable_let_patterns`.

  This seems to be a fallout from rust-lang#108504. Before 05082f5, when the visitor operated on HIR rather than THIR, check lint attributes for the said lints were effective. [This playground][play] compiles successfully on current stable (1.69) but fails on current beta and nightly.

  I wasn't sure where best to place the test for this. Let me know if there's a better place.

[play]: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=38432b79e535cb175f8f7d6d236d29c3
[play-match]: https://play.rust-lang.org/?version=beta&mode=debug&edition=2021&gist=629aa71b7c84b269beadeba664e2221d
…illot

Always capture slice when pattern requires checking the length

Fixes rust-lang#111751

cc ``@zirconium-n,`` I see you were assigned to this but I've fixed some similar issues in the past and had an idea on how to investigate this.
…=wesleywiser

Don't print newlines in APITs

This is kind of a hack, but it gets the job done because the only "special" formatting that (afaict) `rustc_ast_pretty` does is break with newlines sometimes.

Fixes rust-lang/measureme#207
…lor-7, r=notriddle

Migrate GUI colors test to original CSS color format

Follow-up of rust-lang#111459.

r? ``@notriddle``
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels May 25, 2023
@compiler-errors
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented May 25, 2023

📌 Commit c2e3521 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 25, 2023
@bors
Copy link
Contributor

bors commented May 25, 2023

⌛ Testing commit c2e3521 with merge 0004b3b...

@bors
Copy link
Contributor

bors commented May 26, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing 0004b3b to master...

1 similar comment
@bors
Copy link
Contributor

bors commented May 26, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing 0004b3b to master...

@bors bors added merged-by-bors This PR was explicitly merged by bors. labels May 26, 2023
@bors bors merged commit 0004b3b into rust-lang:master May 26, 2023
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Perf Build Sha

previous master: 0004b3b984

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rustbot rustbot added this to the 1.71.0 milestone May 26, 2023
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Perf Build Sha
#111950 da773cbc4b09c12e9753df32f4d398c76c2828ef
#111945 3d4cda07dd7ec14f1e56927c7ef65a69995a37c4
#111929 5472a1df682c94506236de28b56c17293d49b343
#111831 c58283f22b600846d7461116f086d6750101d8e9
#111757 f77cb362568b4340692f8784cb8e677f017bbac0
#111152 165c3d9a519c20cd69a4b48ebf3606b58b4ef69e
#107522 5563547e85df644eb671e25766341e36a55db504

previous master: a2b1646c59

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0004b3b): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.5% [-1.3%, -0.2%] 65
Improvements ✅
(secondary)
-0.6% [-1.2%, -0.2%] 18
All ❌✅ (primary) -0.5% [-1.3%, -0.2%] 65

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.3% [-4.1%, -0.9%] 83
Improvements ✅
(secondary)
-3.1% [-4.6%, -0.8%] 53
All ❌✅ (primary) -2.3% [-4.1%, -0.9%] 83

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.1% [-1.6%, -0.7%] 3
Improvements ✅
(secondary)
-1.9% [-2.0%, -1.7%] 2
All ❌✅ (primary) -1.1% [-1.6%, -0.7%] 3

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.6% [-8.8%, -0.0%] 34
Improvements ✅
(secondary)
-2.0% [-7.4%, -0.1%] 8
All ❌✅ (primary) -1.6% [-8.8%, -0.0%] 34

Bootstrap: 648.599s -> 644.952s (-0.56%)

@pnkfelix
Copy link
Member

@rust-timer build da773cbc4b09c12e9753df32f4d398c76c2828ef

@rust-timer

This comment has been minimized.

@pnkfelix
Copy link
Member

(To satisfy my own curiosity, requesting rust-timer build on PR #111950)

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (da773cbc4b09c12e9753df32f4d398c76c2828ef): comparison URL.

Overall result: ✅ improvements - no action needed

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.5% [-1.3%, -0.2%] 71
Improvements ✅
(secondary)
-0.5% [-1.2%, -0.2%] 22
All ❌✅ (primary) -0.5% [-1.3%, -0.2%] 71

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.3% [-4.3%, -0.8%] 84
Improvements ✅
(secondary)
-2.9% [-4.6%, -0.9%] 40
All ❌✅ (primary) -2.3% [-4.3%, -0.8%] 84

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.2% [-1.6%, -0.6%] 6
Improvements ✅
(secondary)
-1.4% [-1.4%, -1.4%] 2
All ❌✅ (primary) -1.2% [-1.6%, -0.6%] 6

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.5% [-8.8%, -0.0%] 37
Improvements ✅
(secondary)
-2.0% [-7.4%, -0.1%] 8
All ❌✅ (primary) -1.5% [-8.8%, -0.0%] 37

Bootstrap: 648.599s -> 645.284s (-0.51%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants